import request from '@/config/axios'

// 报告-人员关系 VO
export interface PresentationPersonRelationVO {
  id: number // 关系ID
  presentationId: string // 报告ID
  personId: number // 重点人ID
}

// 报告-人员关系 API
export const PresentationPersonRelationApi = {

  // 查询报告-人员关系分页
  getPresentationPersonRelationPage: async (params: any) => {
    return await request.get({ url: `/member/presentation-person-relation/page`, params })
  },

  // 查询报告-人员关系详情
  getPresentationPersonRelation: async (id: number) => {
    return await request.get({ url: `/member/presentation-person-relation/get?id=` + id })
  },

  // 新增报告-人员关系
  batchCreateCasePersonRelation: async (data: { personIdList: any; presentationId: number | undefined }) => {
    return await request.post({ url: `/member/presentation-person-relation/create`, data })
  },

  // 修改报告-人员关系
  updatePresentationPersonRelation: async (data: PresentationPersonRelationVO) => {
    return await request.put({ url: `/member/presentation-person-relation/update`, data })
  },

  // 删除报告-人员关系
  deletePresentationPersonRelation: async (presentationId: number, personId: number) => {
    // 使用模板字符串使URL拼接更清晰
    return await request.delete({
      url: `/member/presentation-person-relation/delete`,
      params: { presentationId, personId }
    })
  },

  // 导出报告-人员关系 Excel
  exportPresentationPersonRelation: async (params) => {
    return await request.download({ url: `/member/presentation-person-relation/export-excel`, params })
  }
}
